﻿@model List<Media.Core.Models.Tv.LatestShow>
@{
    ViewBag.Title = "Latest Air Dates";
}
<script type="text/javascript">
    $("#TvNav").addClass("current");
</script>

<link rel="stylesheet" href="@Url.Content("~/Content/Peach/css/sprite.tables.css")"> <!-- SPRITE: Tables styling -->
<h2>Latest Air Dates</h2>

<div class="box">
	<div class="header">
		<img src="@Url.Content("~/Content/Peach/img/icons/packs/fugue/16x16/shadeless/table.png")" width="16" height="16" />
		<h3>Latest Shows</h3><span></span>
	</div>
	<div class="content no-padding">
        <table class="table">
			<thead>
				<tr>
					<th scope="col">Show</th>
					<th scope="col">Episode</th>
					<th scope="col">Name</th>
					<th scope="col">Air Date</th>
				</tr>
			</thead>
            <tbody>
                @for (int i = 0; i < Model.Count(); i++)
                {
                    <tr id="@(Model[i].EpisodeName)" style="@(Model[i].AirDate == DateTime.Today.ToShortDateString().ToString() ? "Color:blue;" : i % 2 == 0 ? "h" : "")">
                        <td style="@(Model[i].AirDate == DateTime.Today.ToShortDateString().ToString() ? "background:#BCD2EE" : "")">@Model[i].ShowName</td>
                        <td style="@(Model[i].AirDate == DateTime.Today.ToShortDateString().ToString() ? "background:#BCD2EE" : "")">
                            @(Model[i].Season < 10 ? "S0" + Model[i].Season.ToString() : "S" + Model[i].Season.ToString())
                            @(Model[i].Episode < 10 ? "E0" + Model[i].Episode.ToString() : "E" + Model[i].Episode.ToString())
                        </td>
                        <td style="@(Model[i].AirDate == DateTime.Today.ToShortDateString().ToString() ? "background:#BCD2EE" : "")">@Model[i].EpisodeName</td>
                        <td style="@(Model[i].AirDate == DateTime.Today.ToShortDateString().ToString() ? "background:#BCD2EE" : "")">@Convert.ToDateTime(Model[i].AirDate).ToLongDateString()</td>
                    </tr>  
                }
            </tbody>
        </table>
    </div>
	<div class="clear"></div>
</div> <!-- End of .box -->
